package com.nl.pulsardemo.io.coutom;

import org.apache.pulsar.functions.api.Record;
import org.apache.pulsar.io.core.Source;
import org.apache.pulsar.io.core.SourceContext;

import java.util.Map;
import java.util.Random;

/**
 * @author : ZhaoY
 * @description :
 * @date : 2021-02-25 15:45
 **/
public class TestSource implements Source<Integer> {
    private int i = 0;

    @Override
    public void open(Map<String, Object> map, SourceContext sourceContext) throws Exception {

    }

    @Override
    public Record<Integer> read() throws Exception {
        return () -> i++;
    }

    @Override
    public void close() throws Exception {

    }
}
